#include <iostream>
#include <unistd.h>
#include <mpi.h>

using namespace std;

int main(int argc, char** argv){

int size, rank;
pid_t pid;

const unsigned hosl = 15;
char hostname[hosl];


MPI_Init(&argc,&argv);

MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_size(MPI_COMM_WORLD,&size);

pid = getpid();

cout << "Hello World! [ Node: " << rank << " / " << size << " ] " << " [ pid: " << pid << " ] ";

if(gethostname(hostname,hosl) == 0){
	cout << " [ hostname " << hostname << " ] ";
} 

cout << endl;

MPI_Finalize();

return 0;
}
